using System.Diagnostics;

namespace AzureContrib.WindowsAzure.Diagnostics
{
	/// <summary>
	/// This <see cref="ITraceSwitchProvider"/> will let anything through!
	/// </summary>
	public class VerboseCatchAllTraceSwitchProvider : ITraceSwitchProvider
	{
		private TraceSwitch loosyGoosyTraceSwitch;

		/// <summary>
		/// Create an instance of the friendly <see cref="TraceSwitch"/> that allows anything!
		/// </summary>
		public VerboseCatchAllTraceSwitchProvider()
		{
			loosyGoosyTraceSwitch = new TraceSwitch("*", "I am a trace swtich that lets anything through.", TraceLevel.Verbose.ToString());
		}

		/// <summary>
		/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
		/// </summary>
		/// <filterpriority>2</filterpriority>
		public void Dispose()
		{ }

		/// <summary>
		/// Find the <see cref="TraceSwitch"/> for this <see cref="ITraceSwitchable"/>?
		/// </summary>
		/// <returns><see cref="TraceSwitch"/></returns>
		public TraceSwitch GetSwitch(ITraceSwitchable traceSwitchable)
		{
			return loosyGoosyTraceSwitch;
		}
	}
}